'\"macro stdmacro
.\"
.\" Copyright (c) 2017 Ken McDonell.  All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMSETPROGNAME 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmSetProgname\f1,
\f3pmGetProgname\f1 \- application name services
.SH "C SYNOPSIS"
.ft 3
.ad l
.hy 0
#include <pcp/pmapi.h>
.sp
void pmSetProgname(const char *\fIprogram\fP);
.br
char *pmGetProgname(void);
.sp
cc ... \-lpcp
.hy
.ad
.ft 1
.SH DESCRIPTION
Within the Performance Co-Pilot (PCP) run-time libraries the name
of a running application is maintained to be used in error and
diagnostic messages.
.PP
The default application name is
.BR pcp .
.PP
.B pmSetProgname
may be used to set the application name to
.I program
after stripping any leading components that begin with the filesystem
path name separator (``/'' for Unix-like systems).
.PP
It is the callers responsibility to ensure the memory pointed to by
.I program
remains available for the life of the application.
Typically, the value passed as
.I program
for a C program would be
.BR argv[0] .
If
.I program
is
.BR NULL ,
the default application name is restored.
.PP
.B pmGetProgname
may be used to return the current application name.
.SH SEE ALSO
.BR PMAPI (3).

.\" control lines for scripts/man-spell
.\" +ok+ argv {from argv[0]}
